home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: What is wrong in this code?
- Date: Sat, 13 Jan 1996 13:32:00 GMT
- Organization: Netcom
- Message-ID: <30f7b305.66373952@nntp.ix.netcom.com>
- References: <DL2z7o.2K5@scisun.sci.ccny.cuny.edu> <4d7kvv$j8@ub239.dialup.uwa.edu.au>
- NNTP-Posting-Host: ix-dc11-30.ix.netcom.com
- X-NETCOM-Date: Sat Jan 13 5:31:45 AM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- prye@cyllene.uwa.edu.au (Peter Rye) wrote:
-
- |>>x = pow(x,x);
- |> ^-------------------- This line is a problem.
- |> I believe this will give rise to
- |> "undefined behavior" because you
- |> are modifying x using a function
- |> which takes x as an argument.
- |> Use something like y = pow(x,x);
- |> Where y is declared as a double,
- |> then use y in the printf below.
-
- Huh? There's nothing in this statement that results in undefined
- behavior. An object may be referenced and stored between sequence
- points provided the referenced value is used to determine the value to
- be stored (ISO 6.3) and that certainly holds here.
-
-
- Michael M Rubenstein
-